package com.docking.heylo.utils;

import com.alibaba.fastjson.JSONObject;
import com.docking.heylo.web.vo.BaseVo;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ResponseUtil {

    public static void write(BaseVo vo, HttpServletResponse response) {
        try {
            response.setCharacterEncoding("utf-8");
            response.setHeader("Content-Type", "text/html; charset=UTF-8");
            response.getWriter().write(JSONObject.toJSONString(vo));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
